<?php
define('ROOT_PATH','./');
define('TEMPLATE_DIR','client/');
require_once(ROOT_PATH.'code/bean/config.inc.php');
require_once(ROOT_PATH.'code/class/client/class.client_user.php');
require_once(ROOT_PATH.'code/bean/smarty.config.inc.php');
require_once(ROOT_PATH.'code/bean/db_config.inc.php');
require_once(ROOT_PATH.'code/class/client/class.union.php');

$game_id = $_GET['game_id'];
$arrGame = array(0=>"武林足球",1=>"武林三国",2=>"武林足球II",3=>"武林英雄");
$user=new client_user();
check_login();
$arrGameServerList = getGameServerList($game_id);
$objUnion = new union();
$siteInfo = $objUnion->getSiteInfo();
$newsList = $objUnion->getNews(2,'',5);//平台新闻
$tpl->assign("nickname",$user->nick_name);
$tpl->assign('siteInfo',$siteInfo);	
$tpl->assign('ptxw',$newsList);	
$tpl->assign('game_id',$game_id);
$tpl->assign('game_title',$arrGame[$game_id]);
$tpl->assign('server_list',$arrGameServerList);//var_dump($arrGameServerList);
$tpl->display('game_server_list.html');
function getGameServerList($game_id) 
{
	$sql = "select * from game_type where game_id='".$game_id."'";
	$res = sql_get_arr($sql,__LINE__);
	if($res)
	{
		$length = count($res)-1;
		$arrList = array();
		for($i=0;$i<$length;$i++)
		{
			$arrList[] = $res[$i];
		}        
	}
	return $arrList;
}
?>